package com.yhos.platform.oopston.core.aop;

import com.yhos.platform.oopston.core.utils.MessageSourceUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;

@Aspect
@Order(3)
public class BaseValidatorAspect extends ValidatorAspect {

    @Autowired
    private MessageSourceUtils messageSourceUtils;

    @Pointcut("execution(* com.yhos.platform.oopston.web.*.*.*(..))")
    @Override
    public void controllerMethodPointcut() {
        super.controllerMethodPointcut();
    }

    @Around("controllerMethodPointcut()")
    @Override
    public Object processAspect(ProceedingJoinPoint point) throws Throwable {
        super.setMessageSourceUtils(messageSourceUtils);
        return super.processAspect(point);
    }

}
